package com.zzyl.service;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.AlertRuleDTO;
import com.zzyl.entity.AlertRule;
import com.zzyl.entity.DeviceData;
import com.zzyl.vo.AlertRuleVo;

import java.util.List;

public interface AlertRuleService {

    /**
     * 创建报警
     *
     * @param alertRuleDto 规则对象
     * @return
     */
    ResponseResult createAlertRule(AlertRuleDTO alertRuleDto);

    ResponseResult<PageResponse<AlertRuleVo>> getAlertRulePage(Integer pageNum,
                                                               Integer pageSize,
                                                               String alertRuleName,
                                                               String productKey,
                                                               String functionName);

    ResponseResult<AlertRuleVo> getAlertRuleById(Long id);

    ResponseResult updateAlertRule(AlertRuleDTO dto);

    ResponseResult updateAlertRuleStatus(Integer id, Integer status);

    ResponseResult deleteAlertRule(Long id);

    /**
     * 校验设备上报数据，进行报警规则过滤处理，如果数据有异常标识status=2
     *
     * @param deviceDataList 设备上报数据列表
     */
    void alertFilter(List<DeviceData> deviceDataList);
}
